<?php
/**
* @package Scribble
*/
use Buan\Config;
use Buan\UrlCommand;
$urlRoot = Config::get('ext.Scribble.urlRoot');

ScribbleAdminView::getGlobalView()->addStylesheets("{$urlRoot}/css/scribble/media-library/folder.css");
ScribbleAdminView::getGlobalView()->addJavascripts("{$urlRoot}/js/scribble/media-library/folder.js", "{$urlRoot}/js/scribble-auth-widget.js");
?>

<div class="head">
	<h1>Folder Settings</h1>
</div>

<form method="post" action="<?php $this->html->eUrl(UrlCommand::createUrl('scribble', 'media-library', 'folder', array('f'=>$folder))); ?>">
	<div class="std-tabbed">
		<div class="std">
			<h3><u>P</u>rivileges</h3>

			<dl>
				<dt>Security settings:</dt>
				<dd>
					<label><input id="security-inherit" type="radio" name="security" value="inherit" <?php echo $folderSecurity==='inherit' ? 'checked="checked"' : ''; ?> />Inherit settings from parent folder</label><br/>
					<label><input id="security-allow-all" type="radio" name="security" value="allow-all" <?php echo $folderSecurity==='allow-all' ? 'checked="checked"' : ''; ?> />Allow everyone to view the contents of this folder</label><br/>
					<label><input id="security-auth" type="radio" name="security" value="auth" <?php echo $folderSecurity==='auth' ? 'checked="checked"' : ''; ?> />Let me define who can see this folder's contents ...</label>
				</dd>
			</dl>

			<div id="privileges">
				<input rel="scribble-widget" scribblewidget:type="privilege-editor" scribblewidget:config="resourceId=<?php echo $folderId; ?>" type="hidden" name="privilege" value="<?php $this->html->e($privilegeData); ?>" />
			</div>
		</div>
	</div>

	<p>
		<button class="submit" type="submit" value="Save">Save</button>
		<button class="delete" type="submit" name="method" value="Delete" rel="folder-delete" disabled="disabled">Delete</button>
	</p>
</form>